1/1
lan to FPGA
by qiudanyi1 on Mar 21, 2014 |
qiudanyi1
Posts: 1 Joined: Mar 10, 2014 Last seen: Dec 27, 2024 |
||
dear all:
i'm student.I want to use FPGA to do that convert data speed on the lan ,for example ,the data speed on the lan is variable and want data speed is stable as 4Mbps�what should I do �thank you very much! best regards Mose |
RE: lan to FPGA
by tbernath on Mar 22, 2014 |
tbernath
Posts: 4 Joined: Jun 9, 2008 Last seen: Jul 22, 2024 |
||
That is a great project to start on!
Here are a couple things to think about: - are you using a single port? If so, how are you handling MAC/IP addresses - if you modify anything, you may have to recalculate FCS for Ethernet Here is what I would propose: - take the raw inputs from the Ethernet PHY (RGMII, GMII, MII, RMII etc) - use the DV (Data Valid) signal to enable a buffer (like a block ram) - run all the data values into the block RAM ( data, err, dv, etc) - build a module that reads from the block RAM at 4 Mb, see below - put the output directly on to the TX of another port - your clocking comes from the received data, so you don't have to build sophisticated timing Then you will have data coming in from one port, and being sent out the second port at about the speed you require. The challenge is that you only want 4Mb/s on the output, but you need to keep packets together. So I suggest you burst the single packets, then pause until you have waited long enough that your next packet is still under 4Mb. The alternative is to tinker with PAUSE frames. Consider back-inserting the packet length after inserting it into the buffer. Read that before sending out the data, so that you can calculate a pause such that you don't really blow your output rate. Use a BRAM data line to differentiate the packet/length from the regular data. so, 16 bits of BRAM can store 8 bits of data, dv. dverr. and at the same time, store the packet length, and another data line to show its a packet length, and not packet data. I would build a counter that keeps track of the output, when it gets to 0, you can put more data on the wire. Read the packet length, calculate a value to add to the counter, wait for it to hit 0, then copy next packet from the buffer to the line. That sounds like a great little project! Good Luck! TMB |
1/1